package com.zzyl.nursing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.domain.Reservation;
import com.zzyl.nursing.vo.AppointmentsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface MemberReservationMapper extends BaseMapper<Reservation> {
    @Select("select time, 6 - count(*) as count from reservation\n" +
            "    where time between #{start} and #{end}\n" +
            "    and status != 2 group by time;")
    List<AppointmentsVo> getCountByTime(@Param("start") LocalDateTime start,@Param("end") LocalDateTime end);
}
